<!--  -->
<template>
  <div class="header">
    <div class="logo">LOGO</div>
    <div class="title">
      {{ title }}
    </div>
    <div class="right">
      <div class="item time">
        <i class="el-icon-timer"></i>
        <span>
          {{ time }}
        </span>
      </div>
      <div class="item date">
        <i class="el-icon-date"></i>
        <span>
          {{ date }}
        </span>
      </div>
      <div class="tips">技术支持：辰寅科技</div>
      <div class="update-time">最新数据更新于15:00:00</div>
    </div>
  </div>
</template>

<script>
import moment from "moment";
export default {
  mounted() {
    this.timer = setInterval(() => {
      this.time = moment().format("HH:mm:ss");
    }, 1000);
  },
  props: {
    title: {
      type: String,
      default: "芳迪MES",
    },
  },
  data() {
    return {
      time: moment().format("HH:mm:ss"),
      date: moment().format("YYYY-MM-DD"),
      timer: null,
    };
  },

  methods: {},

  components: {},
  beforeDestroy() {
    clearInterval(this.timer);
  },
  computed: {},
};
</script>
<style lang="scss" scoped>
.header {
  width: 100%;
  height: 100px;
  background: url("../../assets/bigScreen/header-bg.png");
  background-size: 100% 100%;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  position: relative;
  .logo {
    color: #fff;
    font-weight: bold;
    font-size: 50px;
    position: absolute;
    left: 80px;
    top: 28px;
  }
  .title {
    color: #fff;
    font-weight: bold;
    font-size: 38px;
  }
  .right {
    position: absolute;
    right: 0;
    color: #b9babe;
    font-size: 22px;
    top: 36px;
    display: flex;
    padding-right: 18px;
    .item {
      span {
        margin-left: 4px;
      }
    }
    .date {
      margin-left: 40px;
    }

    .tips {
      margin-left: 46px;
      font-style: italic;
      font-size: 16px;
      font-weight: bold;
      position: relative;
      color: #9a9ca1;
    }
    .update-time {
      position: absolute;
      right: 18px;
      top: 30px;
      font-size: 16px;
      color: #9a9ca1;
    }
  }
}
</style>
